import React, { useRef } from 'react'
import { Swiper, SwiperItem, View } from '@tarojs/components'
import { backgroundObj } from '@/utils/utils'
import './index.scss'
export default (props) => {
  const { list = [], className, tagDom = false } = props


  const items = list.map((image, index) => (
    <SwiperItem key={index}>
      <View style={{ width: '100%', height: '100%', ...backgroundObj(image) }}></View>
      {tagDom ? tagDom : null}
    </SwiperItem>
  ))
  return <Swiper
    className={`swiper-box ${className}`}
  >
    {items}
  </Swiper>


}